<?php
$this->load->view("header");
?>

<div>
    <form method ="post" action="<?=site_url()?>/order/submit_order">
    <div>
        <?php
         if($userinfo->dorm==""||$userinfo->phone==""||$userinfo->name==""){
         ?>
        <h4>请完善你的信息</h4>
       <ul>

            <?php if($userinfo->name==""){?><li>收货人：<input type="text" name="consignee" id="consignee"/></li><?php } ?>
            <?php if($userinfo->dorm==""){?><li>寝室地址：<input type="text" name="dorm" id="dorm"/></li><?php } ?>
            <?php if($userinfo->phone==""){?><li>手机：<input type="text" name="phone" id="phone"/></li><?php } ?>
            <?php if($userinfo->short_phone==""){?><li>虚拟网短号：<input type="text" name="short_phone" id="short_phone"/></li><?php } ?>
        </ul>
        <p><font color="red"><?=$warning?></font></p>
       <?php
         }?>
    </div>

    <div>
        <h4>书籍清单</h4>
        
        <table>
        <tr>
            <th width="200px">书名</th>
            <th width="100px">书易价</th>
            <th width="100px">数量</th>
            <th width="100px">总计</th>
        </tr>

<?PHP
          $n = 0;
          if( $order_info != null )
              foreach($order_info as $order){
                  $n++;
                  echo "<tr>";
                  echo "<td width=\"200px\" align=\"center\">" .$order->title .
                       "<input type=\"hidden\" name=\"title_" .$n. "\" value=\"" .$order->title. "\"/> </td>" .
                       "<input type=\"hidden\" name=\"book_id_" .$n. "\" value=\"" .$order->book_id. "\"/> </td>";
                  echo "<td width=\"100px\" align=\"center\">" .$order->price .
                       "<input type=\"hidden\" name=\"price_" .$n. "\" value=\"" .$order->price. "\"/> </td>";
                  echo "<td width=\"100px\" align=\"center\">" .$order->order_number .
                       "<input type=\"hidden\" name=\"order_number_"  .$n. "\" value=\"" .$order->order_number. "\"/> </td>";
                  echo "<td width=\"100px\" align=\"center\">" .$order->total .
                       "<input type=\"hidden\" name=\"total_"  .$n. "\" value=\"" .$order->total. "\"/> </td>";
                  echo "</tr>";
              }
          else{
              echo "你没有订购书籍！";
          }
?>
    </table>            
        <input type="submit" value="提交订单">
        <input type="hidden" name="num_kinds" value="<?=$n?>"/> <!-- 表示有多少种成色的书籍 -->
        <input type="hidden" name="go" value="yes"/>
       
    </div>
    </form>
</div>


<?php
$this->load->view("footer");
?>